<template>
	<om-formsub-outer :index="index" :checkedit="checkedit">
		<om-autoform ref="autoform" :edit="edit" :checkedit="checkedit" :initConfigData="autoformdata" :initValue="initValue"></om-autoform>
	</om-formsub-outer>
</template>

<script>
import {
		buildSubFormData,
		subOnLoad,
		changeEditor,
		configSelectData
	} from '../../../static/js/formUtil.js';
	import {
		ignoreHtml,
		ptFloat,
		minusF,
		getDateStr
	} from '@/static/js/common.js';
	import urlUtil from '@/static/js/urlUtil.js';
	export default {
		provide() {
			return {
				formPage: this
			};
		},
		data(){
			return buildSubFormData({
				lList:[]
			}
		)},
		methods:{
			onSelectInterviewElement(item){
				this.$refs.autoform.formdata.score = item.score
			}
		},
		onShow() {
			
		},
		onLoad(e) {
			let _that = this
			subOnLoad(_that, e, function() {
				if (e.configDataCacheKey) {
					_that.exists = _that.datas.filter((e,i)=>{
						return (i != _that.index)
					}).map(e=>e.interviewElementId).join(",")
					uni.getStorage({
						key: e.configDataCacheKey,
						success: function(res) {
							//if (res.data && res.data instanceof Array) {
							if(res.data && Object.prototype.toString.call(res.data)==='[object Array]'){
								_that.autoformdata = res.data
							}
							Object.assign(_that.initValue, _that.formdata)
							_that.autoformdata[0].order = _that.order
							_that.om.request(
								"trecruitAgencyInterviewEvaluate/getElement",
								{
									lList:_that.exists
								},
								"post"
							).then(res=>{
								_that.$refs.autoform.changeEditor('title15','interviewElementId','data',configSelectData(res,'id','dicname'))
								_that.$refs.autoform.initSelectIndex('title15','interviewElementId')
							})
							
						}
					})
				}
			})
		}
	}
</script>

<style>
</style>
